# Simple Makefile for 6.837 raycasting assignment
# for g++ on linux platforms

# ===============================================================

INCFLAGS  = -g -O3 -I../d_Math -Iinclude/
LINKFLAGS = -lm  -L/usr/X11R6/lib -lXmu -lXi -lGL -lGLU -lSDL -L/usr/lib ../lib/libd_Math.a
CC		= g++
SRCS 	 	= src/main.cc \
		  src/sphere.cc \
		  src/group.cc \
		  src/camera.cc \
		  src/scene_parser.cc \
		  src/plane.cc \
		  src/triangle.cc \
		  src/transform.cc \
		  src/material.cc \
		  src/cylinder.cc \
		  src/cone.cc \
		  src/light.cc \
		  src/image.cc \
		  src/raytracer.cc \
		  src/boundingSphere.cc \
		  src/perlin_noise.cc \
		  src/sampleDebugger.cc \
		  src/csgobject.cc 

OBJS =  $(SRCS:.cc=.o)
PROG = d_RayTracer

.PHONY: all depend clean

all: depend $(PROG)

$(PROG): $(OBJS)
	$(CC) $(CFLAGS) $(OBJS) -o $@ $(LINKFLAGS)

.cc.o:
	$(CC) $(CFLAGS) $< -c -o $@ $(INCFLAGS)

depend:
	$(CC) $(INCFLAGS) -E -M $(SRCS) > Makefile.depend

clean: 
	-rm -rf src/*~ src/*bak src/*.o  src/core.* Makefile.depend  \
$(PROG) 

# ===============================================================

-include Makefile.depend


